package com.shop.merchant.config;

import com.shop.merchant.Interceptor.GetMerchantInfoInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 'banxia'
 * @version 1.0
 * @description 添加拦截器
 * @date 2023/2/21 23:42
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        GetMerchantInfoInterceptor getMerchantInfo = new GetMerchantInfoInterceptor();
        registry.addInterceptor(getMerchantInfo).order(0);
    }
}
